cmake_minimum_required (VERSION 2.6)

set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s;S)
PROJECT(BubblesOS CXX C ASM)

set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "")
set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")

IF("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "i386")
	SET(X86 ON)
	SET(X86_COMMON ON)
ENDIF("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "i386")

set(KINCLUDES "-DKERNEL -I. -I${CMAKE_SOURCE_DIR} -I${CMAKE_SOURCE_DIR}/kernel -I${CMAKE_SOURCE_DIR}/java/jre -I${CMAKE_SOURCE_DIR}/lib/stdc/include -I${CMAKE_SOURCE_DIR}/lib/stdcxx/include -I${CMAKE_SOURCE_DIR}/lib/elf/include -I${CMAKE_SOURCE_DIR}/lib/plosdk/core -I${CMAKE_SOURCE_DIR}/lib/plosdk/exception")
IF(X86)
	SET(KINCLUDES "${KINCLUDES} -DX86")
ENDIF(X86)
IF(X86_COMMON)
	SET(KINCLUDES "${KINCLUDES} -DX86_COMMON")
ENDIF(X86_COMMON)

IF(X86)
SET(KERNEL_CXX_PROCESSOR_SPEC_SRC
	machine/pc/processor/x86/processorstate.h
	machine/pc/processor/x86/taskstatesegment.h
	machine/pc/processor/x86/gdt.cpp
	machine/pc/processor/x86/gdt.h
	machine/pc/processor/x86/processor.cpp
	machine/pc/processor/x86/processor.h
	machine/pc/processor/x86/interruptmanager.cpp
	machine/pc/processor/x86/interruptmanager.h
	machine/pc/processor/x86/interruptstate.h
	machine/pc/processor/x86/interruptstate.cpp
	machine/pc/processor/x86/pic.cpp
	machine/pc/processor/x86/pic.h
	machine/pc/processor/x86/pit.cpp
	machine/pc/processor/x86/pit.h
)
SET(KERNEL_ASM_PROCESSOR_SPEC_SRC
	machine/pc/processor/x86/boot.s
	machine/pc/processor/x86/interruptmanager.s
)
ENDIF(X86)

SET(KERNEL_START
	main.cpp
	bootstrapinfo.h
)

SET(KERNEL_LIB_SRC
	lib/kvector.h
	lib/atomic.h
	lib/lockguard.h
	lib/spinlock.cpp
	lib/spinlock.h
    lib/tar.cpp
    lib/tar.h
    lib/tarheader.cpp
    lib/tarheader.h
    lib/tarfile.cpp
    lib/tarfile.h
    lib/tarheaderustar.cpp
    lib/tarheaderustar.h
    lib/modulehandler.cpp
    lib/modulehandler.h
    lib/moduleinfo.cpp
    lib/moduleinfo.h
)

SET(KERNEL_INITRD_SRC
    initrd/initrd.cpp
    initrd/initrd.h
    initrd/inireader.cpp
    initrd/inireader.h
    initrd/initrdmodulehandler.cpp
    initrd/initrdmodulehandler.h
    initrd/initrdmoduleinfo.cpp
    initrd/initrdmoduleinfo.h
)

SET(KERNEL_MACHINE_SRC
	machine/machine.h
	machine/machine.cpp
)

SET(KERNEL_MACHINE_PC_SRC
	machine/pc/ioportmanager.cpp
	machine/pc/ioportmanager.h
	machine/pc/iobase.h
	machine/pc/ioport.cpp
	machine/pc/ioport.h
)

SET(KERNEL_MACHINE_PROCESSOR_SRC
	machine/pc/processor/processor.cpp
	machine/pc/processor/processor.h
	machine/pc/processor/interrupthandler.h
	machine/pc/processor/irqmanager.h
	machine/pc/processor/irqhandler.h
	machine/pc/processor/timerhandler.h
	machine/pc/processor/schedulertimer.h
	machine/pc/processor/pagefaulthandler.cpp
	machine/pc/processor/pagefaulthandler.h
)

SET(KERNEL_MACHINE_MEMORY_SRC
	machine/pc/memory/memhandlerinterface.h
	machine/pc/memory/staticmemhandler.h
	machine/pc/memory/staticmemhandler.cpp
	machine/pc/memory/memmanager.h
	machine/pc/memory/memmanager.cpp
	machine/pc/memory/physicalpagemanager.h
	machine/pc/memory/physicalpagemanager.cpp
	machine/pc/memory/virtualpagemanager.cpp
	machine/pc/memory/virtualpagemanager.h
	machine/pc/memory/virtualpageinterface.h
	machine/pc/memory/virtualpagewithoutpae4k.cpp
	machine/pc/memory/virtualpagewithoutpae4k.h
	machine/pc/memory/pagememhandler.cpp
	machine/pc/memory/pagememhandler.h
)

SET(KERNEL_MACHINE_PROCESS_SRC
	machine/pc/process/process.cpp
	machine/pc/process/process.h
	machine/pc/process/thread.cpp
	machine/pc/process/thread.h
	machine/pc/process/processinstancemanager.cpp
	machine/pc/process/processinstancemanager.h
)

SET(KERNEL_GLOBAL_SRC
	cppsupport.cpp
	cppsupport.h
	new.cpp
	bootoutput.cpp
	bootoutput.h
	output.cpp
	output.h
	kerneldebugconsole.cpp
	kerneldebugconsole.h
	colorvga16.cpp
	colorvga16.h
	osloader.cpp
	osloader.h
	commandline.cpp
	commandline.h
	assert.cpp
	abort.cpp
	malloc.cpp
	kernelelf.cpp
	kernelelf.h
	crtload.cpp
	crtload.h
	kprintf.cpp
	kprintf.h
    printf.cpp
    errno.cpp
)

SET(KERNEL_LIBC_SRC
	../lib/stdc/src/string/memset.cpp
	../lib/stdc/src/string/memcpy.cpp
	../lib/stdc/src/string/memcmp.cpp
	../lib/stdc/src/string/strcmp.cpp
	../lib/stdc/src/string/strncmp.cpp
	../lib/stdc/src/string/strcpy.cpp
	../lib/stdc/src/string/strlen.cpp
	../lib/stdc/src/string/strnlen.cpp
	../lib/stdc/src/stdlib/skip_atoi.cpp
	../lib/stdc/src/stdlib/number.cpp
	../lib/stdc/src/stdlib/eaddr.cpp
	../lib/stdc/src/stdlib/iaddr.cpp
	../lib/stdc/src/stdlib/cfltcvt.cpp
	../lib/stdc/src/stdlib/forcdecpt.cpp
	../lib/stdc/src/stdlib/cropzeros.cpp
	../lib/stdc/src/stdlib/flt.cpp
	../lib/stdc/src/stdlib/cvt.cpp
	../lib/stdc/src/stdlib/ecvt.cpp
	../lib/stdc/src/stdlib/ecvtbuf.cpp
	../lib/stdc/src/stdlib/fcvt.cpp
	../lib/stdc/src/stdlib/fcvtbuf.cpp
    ../lib/stdc/src/stdlib/strtod.cpp
    ../lib/stdc/src/stdlib/atof.cpp
    ../lib/stdc/src/stdlib/atoi.cpp
    ../lib/stdc/src/stdlib/atol.cpp
    ../lib/stdc/src/stdlib/strtol.cpp
    ../lib/stdc/src/stdlib/strtoul.cpp
    ../lib/stdc/src/stdlib/strtoi.cpp
	../lib/stdc/src/math/modf.cpp
	../lib/stdc/src/math/modf.c
	../lib/stdc/src/math/fabs.cpp
	../lib/stdc/src/math/fabs.c
	../lib/stdc/src/stdio/vsprintf.cpp
	../lib/stdc/src/stdio/sprintf.cpp
	../lib/stdc/src/ctype/isdigit.c
	../lib/stdc/src/ctype/ctypeflags.c
    ../lib/stdc/src/ctype/isspace.c
    ../lib/stdc/src/ctype/isalpha.c
    ../lib/stdc/src/ctype/isupper.c
    ../lib/stdc/src/ctype/isxdigit.c
    ../lib/stdc/src/ctype/toupper.c
    ../lib/stdc/src/ctype/isalnum.c
    ../lib/stdc/src/ctype/islower.c
	../lib/stdc/src/setjmp/setjmp.s
	../lib/stdc/include/assert.h
	../lib/stdc/include/string.h
	../lib/stdc/include/stdlib.h
	../lib/stdc/include/stdio.h
	../lib/stdc/include/limits.h
	../lib/stdc/include/sys/cdefs.h
	../lib/stdc/include/setjmp.h
	../lib/stdc/include/iso646.h
	../lib/stdc/include/stdbool.h
	../lib/stdc/include/stdarg.h
	../lib/stdc/include/math.h
    ../lib/stdc/include/float.h
)

SET(KERNEL_LIBCXX_SRC
	../lib/stdcxx/include/type_traits
	../lib/stdcxx/include/typeinfo
	../lib/stdcxx/include/new
	../lib/stdcxx/include/exception
	../lib/stdcxx/include/tinfo.h
	../lib/stdcxx/include/cxxabi.h
	../lib/stdcxx/include/cxxabi_tweaks.h
	../lib/stdcxx/include/demangle.h
	../lib/stdcxx/include/cp-demangle.h
	../lib/stdcxx/src/function_type_info.cpp
	../lib/stdcxx/src/si_class_type_info.cpp
	../lib/stdcxx/src/class_type_info.cpp
	../lib/stdcxx/src/tinfo.cpp
	../lib/stdcxx/src/vmi_class_type_info.cpp
	../lib/stdcxx/src/pointer_type_info.cpp
	../lib/stdcxx/src/pbase_type_info.cpp
	../lib/stdcxx/src/eh_aux_runtime.cpp
	../lib/stdcxx/src/eh_exception.cpp
	../lib/stdcxx/src/array_type_info.cpp
	../lib/stdcxx/src/bad_cast.cpp
	../lib/stdcxx/src/bad_typeid.cpp
	../lib/stdcxx/src/del_op.cpp
	../lib/stdcxx/src/del_opnt.cpp
	../lib/stdcxx/src/del_opv.cpp
	../lib/stdcxx/src/del_opvnt.cpp
	../lib/stdcxx/src/dyncast.cpp
	../lib/stdcxx/src/eh_term_handler.cpp
	../lib/stdcxx/src/eh_terminate.cpp
	../lib/stdcxx/src/eh_unex_handler.cpp
	../lib/stdcxx/src/enum_type_info.cpp
	../lib/stdcxx/src/fundamental_type_info.cpp
	../lib/stdcxx/src/cp-demangle.c
	../lib/stdcxx/src/new_handler.cpp
	../lib/stdcxx/src/new_op.cpp
)

SET(KERNEL_LIBELF_SRC
	../lib/plosdk/core/elf/plelfstddef.h
	../lib/plosdk/core/elf/plelfheader32.cpp
	../lib/plosdk/core/elf/plelfheader32.h
	../lib/plosdk/core/elf/plelfheaderenums.h
	../lib/plosdk/core/elf/plelfheaderenums.cpp
	../lib/plosdk/core/elf/plelfheader64.cpp
	../lib/plosdk/core/elf/plelfheader64.h
	../lib/plosdk/core/elf/plelfidentification.h
	../lib/plosdk/core/elf/plelfsectionheader32.h
	../lib/plosdk/core/elf/plelfsectionheader64.h
	../lib/plosdk/core/elf/plelfsectionheaderenums.h
	../lib/plosdk/core/elf/plelfsectionheaderenums.cpp
	../lib/plosdk/core/elf/plelfstringtable.h
	../lib/plosdk/core/elf/plelfstringtable.cpp
	../lib/plosdk/core/elf/plelfsymboltable32.h
	../lib/plosdk/core/elf/plelfsymboltable64.h
	../lib/plosdk/core/elf/plelfsymboltableenum.h
	../lib/plosdk/core/elf/plelfrelocation32.h
	../lib/plosdk/core/elf/plelfrelocation64.h
	../lib/plosdk/core/elf/plelfrelocationa32.h
	../lib/plosdk/core/elf/plelfrelocationa64.h
	../lib/plosdk/core/elf/plelfapplicationheader32.h
	../lib/plosdk/core/elf/plelfapplicationheader64.h
	../lib/plosdk/core/elf/plelfapplicationheaderenums.h
	../lib/plosdk/core/elf/plelfbase.h
	../lib/plosdk/core/elf/plelfbase.cpp
	../lib/plosdk/core/elf/plelf32.h
	../lib/plosdk/core/elf/plelf32.cpp
	../lib/plosdk/core/elf/plelf64.h
	../lib/plosdk/core/elf/plelf64.cpp
	../lib/plosdk/core/elf/plelf.h
    ../lib/plosdk/core/elf/plelfsymbol32.h
    ../lib/plosdk/core/elf/plelfsymbol64.h
)

SET(LIB_PLSDK_CORE_KERNEL_SRC
	../lib/plosdk/core/kernel/PLGlobal.h
	../lib/plosdk/core/kernel/PLExceptionFactory.cpp
	../lib/plosdk/core/kernel/PLExceptionFactory.h
	../lib/plosdk/core/kernel/PLExceptionFactoryElement.cpp
	../lib/plosdk/core/kernel/PLExceptionFactoryElement.h
	../lib/plosdk/core/kernel/PLExceptionHash.cpp
	../lib/plosdk/core/kernel/PLExceptionHash.h
	../lib/plosdk/core/kernel/PLClassIdFactory.cpp
	../lib/plosdk/core/kernel/PLClassIdFactory.h
	../lib/plosdk/core/kernel/PLCStringHash.cpp
	../lib/plosdk/core/kernel/PLCStringHash.h
	../lib/plosdk/core/kernel/PLObject.cpp
	../lib/plosdk/core/kernel/PLObject.h
    ../lib/plosdk/core/kernel/PLOSDefines.h
    ../lib/plosdk/core/kernel/PLTypes.h
	../lib/plosdk/core/kernel/signalslot/PLSignalSlot.h
	../lib/plosdk/core/kernel/signalslot/lang/PLConnection0.h
	../lib/plosdk/core/kernel/signalslot/lang/PLConnection1.h
	../lib/plosdk/core/kernel/signalslot/lang/PLConnection2.h
	../lib/plosdk/core/kernel/signalslot/lang/PLConnection3.h
	../lib/plosdk/core/kernel/signalslot/lang/PLConnection4.h
	../lib/plosdk/core/kernel/signalslot/lang/PLConnection5.h
	../lib/plosdk/core/kernel/signalslot/lang/PLConnection6.h
	../lib/plosdk/core/kernel/signalslot/lang/PLConnection7.h
	../lib/plosdk/core/kernel/signalslot/lang/PLConnection8.h
	../lib/plosdk/core/kernel/signalslot/lang/PLConnection9.h
	../lib/plosdk/core/kernel/signalslot/lang/PLConnection10.h
	../lib/plosdk/core/kernel/signalslot/lang/PLConnectionBase.h
	../lib/plosdk/core/kernel/signalslot/lang/PLConnectionData.cpp
	../lib/plosdk/core/kernel/signalslot/lang/PLConnectionData.h
	../lib/plosdk/core/kernel/signalslot/lang/PLSignalTypes.h
	../lib/plosdk/core/kernel/signalslot/lang/PLSignalBase.cpp
	../lib/plosdk/core/kernel/signalslot/lang/PLSignalBase.h
	../lib/plosdk/core/kernel/signalslot/lang/PLISignalBase0.h
	../lib/plosdk/core/kernel/signalslot/lang/PLISignalBase1.h
	../lib/plosdk/core/kernel/signalslot/lang/PLISignalBase2.h
	../lib/plosdk/core/kernel/signalslot/lang/PLISignalBase3.h
	../lib/plosdk/core/kernel/signalslot/lang/PLISignalBase4.h
	../lib/plosdk/core/kernel/signalslot/lang/PLISignalBase5.h
	../lib/plosdk/core/kernel/signalslot/lang/PLISignalBase6.h
	../lib/plosdk/core/kernel/signalslot/lang/PLISignalBase7.h
	../lib/plosdk/core/kernel/signalslot/lang/PLISignalBase8.h
	../lib/plosdk/core/kernel/signalslot/lang/PLISignalBase9.h
	../lib/plosdk/core/kernel/signalslot/lang/PLISignalBase10.h
	../lib/plosdk/core/kernel/signalslot/lang/PLSignal0.h
	../lib/plosdk/core/kernel/signalslot/lang/PLSignal1.h
	../lib/plosdk/core/kernel/signalslot/lang/PLSignal2.h
	../lib/plosdk/core/kernel/signalslot/lang/PLSignal3.h
)

SET(LIB_PLSDK_KERNEL_LANG_SRC
    ../lib/plosdk/core/kernel/lang/PLHash.h
    ../lib/plosdk/core/kernel/lang/PLHash.cpp
    ../lib/plosdk/core/kernel/lang/PLIHash.h
)

SET(LIB_PLSDK_TOOLS_SRC
	../lib/plosdk/core/tools/PLFlags.h
	../lib/plosdk/core/tools/PLSingleton.h
	../lib/plosdk/core/tools/PLArray.h
	../lib/plosdk/core/tools/PLCharArray.h
	../lib/plosdk/core/tools/PLVector.h
    ../lib/plosdk/core/tools/PLHashTable.h
    ../lib/plosdk/core/tools/PLIEnumerator.h
    ../lib/plosdk/core/tools/PLHashTableKeyEnumerator.h
    ../lib/plosdk/core/tools/PLHashTableEnumerator.h
    ../lib/plosdk/core/tools/PLCharBuffer.h
    ../lib/plosdk/core/tools/PLBuffer.h
    ../lib/plosdk/core/tools/PLRadixTreeVoid.cpp
    ../lib/plosdk/core/tools/PLRadixTreeVoid.h
    ../lib/plosdk/core/tools/PLRadixTreeNode.cpp
    ../lib/plosdk/core/tools/PLRadixTreeNode.h
    ../lib/plosdk/core/tools/PLRadixTree.h
    ../lib/plosdk/core/tools/PLIIterator.h
    ../lib/plosdk/core/tools/PLIterator.h
    ../lib/plosdk/core/tools/PLILinkedListIterator.h
    ../lib/plosdk/core/tools/PLIListIterator.h
    ../lib/plosdk/core/tools/PLLinkedList.h
    ../lib/plosdk/core/tools/PLLinkedListIterator.h
    ../lib/plosdk/core/tools/PLLinkedListNode.h
    ../lib/plosdk/core/tools/PLList.h
    ../lib/plosdk/core/tools/PLListIterator.h
    ../lib/plosdk/core/tools/PLListNode.h
    ../lib/plosdk/core/tools/PLRingList.h
    ../lib/plosdk/core/tools/PLStack.h
)

SET(LIB_PLSDK_EXCEPTION_BASE_SRC
	../lib/plosdk/exception/PLExceptionList.h
	../lib/plosdk/exception/PLExceptionBase.h
	../lib/plosdk/exception/PLExceptionBase.c
)

SET(LIB_PLSDK_EXCEPTION_SRC
	../lib/plosdk/core/exception/PLException.cpp
	../lib/plosdk/core/exception/PLException.h
	../lib/plosdk/core/exception/PLElementNotFoundException.cpp
	../lib/plosdk/core/exception/PLElementNotFoundException.h
	../lib/plosdk/core/exception/PLIndexOutOfRangeException.cpp
	../lib/plosdk/core/exception/PLIndexOutOfRangeException.h
)

SET(JAVA_JRE_SRC
    ../java/jre/PLJava.cpp
    ../java/jre/PLJava.h
    ../java/jre/PLJavaFile.cpp
    ../java/jre/PLJavaFile.h
    ../java/jre/filetypes/PLJavaConst.cpp
    ../java/jre/filetypes/PLJavaConst.h
    ../java/jre/filetypes/PLJavaConstClassInfo.cpp
    ../java/jre/filetypes/PLJavaConstClassInfo.h
    ../java/jre/filetypes/PLJavaConstRefInfo.cpp
    ../java/jre/filetypes/PLJavaConstRefInfo.h
    ../java/jre/filetypes/PLJavaConstTypesString.cpp
    ../java/jre/filetypes/PLJavaConstTypesString.h
    ../java/jre/filetypes/PLJavaConstTypesInteger.cpp
    ../java/jre/filetypes/PLJavaConstTypesInteger.h
    ../java/jre/filetypes/PLJavaConstTypesFloat.cpp
    ../java/jre/filetypes/PLJavaConstTypesFloat.h
    ../java/jre/filetypes/PLJavaConstTypesLong.cpp
    ../java/jre/filetypes/PLJavaConstTypesLong.h
    ../java/jre/filetypes/PLJavaConstTypesDouble.cpp
    ../java/jre/filetypes/PLJavaConstTypesDouble.h
    ../java/jre/filetypes/PLJavaConstNameAndType.cpp
    ../java/jre/filetypes/PLJavaConstNameAndType.h
    ../java/jre/filetypes/PLJavaConstTypesUtf8.cpp
    ../java/jre/filetypes/PLJavaConstTypesUtf8.h
    ../java/jre/filetypes/PLJavaFieldInfo.cpp
    ../java/jre/filetypes/PLJavaFieldInfo.h
    ../java/jre/filetypes/PLJavaAttribute.cpp
    ../java/jre/filetypes/PLJavaAttribute.h
    ../java/jre/filetypes/PLJavaMethodeInfo.cpp
    ../java/jre/filetypes/PLJavaMethodeInfo.h
    ../java/jre/filetypes/PLJavaFieldDescriptor.cpp
    ../java/jre/filetypes/PLJavaFieldDescriptor.h
    ../java/jre/filetypes/PLJavaAttributeCode.cpp
    ../java/jre/filetypes/PLJavaAttributeCode.h
    ../java/jre/filetypes/PLJavaAttributeCodeStack.cpp
    ../java/jre/filetypes/PLJavaAttributeCodeStack.h
    ../java/jre/filetypes/PLJavaInstructionParser.cpp
    ../java/jre/filetypes/PLJavaInstructionParser.h
    ../java/jre/filetypes/PLJavaAttributeExceptionTable.cpp
    ../java/jre/filetypes/PLJavaAttributeExceptionTable.h
    ../java/jre/filetypes/PLJavaAttributeInterface.h
    ../java/jre/filetypes/PLJavaAttributeLineNumberTable.cpp
    ../java/jre/filetypes/PLJavaAttributeLineNumberTable.h
    ../java/jre/filetypes/PLJavaAttributeLineNumberInfo.cpp
    ../java/jre/filetypes/PLJavaAttributeLineNumberInfo.h
    ../java/jre/filetypes/PLJavaAttributeSourceFile.cpp
    ../java/jre/filetypes/PLJavaAttributeSourceFile.h
    ../java/jre/filetypes/PLJavaAttributeStackMapTable.cpp
    ../java/jre/filetypes/PLJavaAttributeStackMapTable.h
    ../java/jre/filetypes/PLJavaAttributeStackMap.cpp
    ../java/jre/filetypes/PLJavaAttributeStackMap.h
    ../java/jre/filetypes/PLJavaAttributeStackMapSame.cpp
    ../java/jre/filetypes/PLJavaAttributeStackMapSame.h
    ../java/jre/filetypes/PLJavaAttributeStackMapSameLocals1StackItem.cpp
    ../java/jre/filetypes/PLJavaAttributeStackMapSameLocals1StackItem.h
    ../java/jre/filetypes/PLJavaAttributeStackMapSameLocals1StackItemExtended.cpp
    ../java/jre/filetypes/PLJavaAttributeStackMapSameLocals1StackItemExtended.h
    ../java/jre/filetypes/PLJavaAttributeStackMapChop.cpp
    ../java/jre/filetypes/PLJavaAttributeStackMapChop.h
    ../java/jre/filetypes/PLJavaAttributeStackMapSameFrameExtended.cpp
    ../java/jre/filetypes/PLJavaAttributeStackMapSameFrameExtended.h
    ../java/jre/filetypes/PLJavaAttributeStackMapAppend.cpp
    ../java/jre/filetypes/PLJavaAttributeStackMapAppend.h
    ../java/jre/filetypes/PLJavaAttributeStackMapFullFrame.cpp
    ../java/jre/filetypes/PLJavaAttributeStackMapFullFrame.h
    ../java/jre/filetypes/PLJavaAttributeStackMapVerificationTypeInfo.cpp
    ../java/jre/filetypes/PLJavaAttributeStackMapVerificationTypeInfo.h
    ../java/jre/filetypes/PLJavaAttributeStackMapVerificationTypeInfoTop.cpp
    ../java/jre/filetypes/PLJavaAttributeStackMapVerificationTypeInfoTop.h
    ../java/jre/filetypes/PLJavaAttributeStackMapVerificationTypeInfoInteger.cpp
    ../java/jre/filetypes/PLJavaAttributeStackMapVerificationTypeInfoInteger.h
    ../java/jre/filetypes/PLJavaAttributeStackMapVerificationTypeInfoFloat.cpp
    ../java/jre/filetypes/PLJavaAttributeStackMapVerificationTypeInfoFloat.h
    ../java/jre/filetypes/PLJavaAttributeStackMapVerificationTypeInfoLong.cpp
    ../java/jre/filetypes/PLJavaAttributeStackMapVerificationTypeInfoLong.h
    ../java/jre/filetypes/PLJavaAttributeStackMapVerificationTypeInfoDouble.cpp
    ../java/jre/filetypes/PLJavaAttributeStackMapVerificationTypeInfoDouble.h
    ../java/jre/filetypes/PLJavaAttributeStackMapVerificationTypeInfoNull.cpp
    ../java/jre/filetypes/PLJavaAttributeStackMapVerificationTypeInfoNull.h
    ../java/jre/filetypes/PLJavaAttributeStackMapVerificationTypeInfoUninitializedThis.cpp
    ../java/jre/filetypes/PLJavaAttributeStackMapVerificationTypeInfoUninitializedThis.h
    ../java/jre/filetypes/PLJavaAttributeStackMapVerificationTypeInfoObjectVariableInfo.cpp
    ../java/jre/filetypes/PLJavaAttributeStackMapVerificationTypeInfoObjectVariableInfo.h
    ../java/jre/filetypes/PLJavaAttributeStackMapVerificationTypeInfoUninitialized.cpp
    ../java/jre/filetypes/PLJavaAttributeStackMapVerificationTypeInfoUninitialized.h
    ../java/jre/filetypes/PLJavaStackValue.cpp
    ../java/jre/filetypes/PLJavaStackValue.h
    ../java/jre/filetypes/PLJavaStackValueEmpty.cpp
    ../java/jre/filetypes/PLJavaStackValueEmpty.h
    ../java/jre/filetypes/PLJavaStackValueInteger.cpp
    ../java/jre/filetypes/PLJavaStackValueInteger.h
    ../java/jre/filetypes/PLJavaStackValueLong.cpp
    ../java/jre/filetypes/PLJavaStackValueLong.h
    ../java/jre/filetypes/PLJavaStackValueFloat.cpp
    ../java/jre/filetypes/PLJavaStackValueFloat.h
    ../java/jre/filetypes/PLJavaStackValueDouble.cpp
    ../java/jre/filetypes/PLJavaStackValueDouble.h
    ../java/jre/filetypes/PLJavaStackValueClassRef.cpp
    ../java/jre/filetypes/PLJavaStackValueClassRef.h
    ../java/jre/filetypes/PLJavaStackValueClassArrayRef.cpp
    ../java/jre/filetypes/PLJavaStackValueClassArrayRef.h
    ../java/jre/filetypes/PLJavaStackValueArray.cpp
    ../java/jre/filetypes/PLJavaStackValueArray.h
    ../java/jre/filetypes/PLJavaStackValueArrayInteger.cpp
    ../java/jre/filetypes/PLJavaStackValueArrayInteger.h
    ../java/jre/filetypes/PLJavaStackValueArrayBoolean.cpp
    ../java/jre/filetypes/PLJavaStackValueArrayBoolean.h
    ../java/jre/filetypes/PLJavaStackValueArrayChar.cpp
    ../java/jre/filetypes/PLJavaStackValueArrayChar.h
    ../java/jre/filetypes/PLJavaStackValueArrayFloat.cpp
    ../java/jre/filetypes/PLJavaStackValueArrayFloat.h
    ../java/jre/filetypes/PLJavaStackValueArrayDouble.cpp
    ../java/jre/filetypes/PLJavaStackValueArrayDouble.h
    ../java/jre/filetypes/PLJavaStackValueArrayByte.cpp
    ../java/jre/filetypes/PLJavaStackValueArrayByte.h
    ../java/jre/filetypes/PLJavaStackValueArrayShort.cpp
    ../java/jre/filetypes/PLJavaStackValueArrayShort.h
    ../java/jre/filetypes/PLJavaStackValueArrayLong.cpp
    ../java/jre/filetypes/PLJavaStackValueArrayLong.h
    ../java/jre/filetypes/PLJavaAttributeCodeLocalVariables.cpp
    ../java/jre/filetypes/PLJavaAttributeCodeLocalVariables.h
    ../java/jre/filetypes/PLJavaDescriptorParser.cpp
    ../java/jre/filetypes/PLJavaDescriptorParser.h
    ../java/jre/filetypes/PLJavaDescriptorValue.cpp
    ../java/jre/filetypes/PLJavaDescriptorValue.h
    ../java/jre/filetypes/PLJavaDescriptorValueVoid.cpp
    ../java/jre/filetypes/PLJavaDescriptorValueVoid.h
    ../java/jre/filetypes/PLJavaDescriptorValueByte.cpp
    ../java/jre/filetypes/PLJavaDescriptorValueByte.h
    ../java/jre/filetypes/PLJavaDescriptorValueChar.cpp
    ../java/jre/filetypes/PLJavaDescriptorValueChar.h
    ../java/jre/filetypes/PLJavaDescriptorValueDouble.cpp
    ../java/jre/filetypes/PLJavaDescriptorValueDouble.h
    ../java/jre/filetypes/PLJavaDescriptorValueFloat.cpp
    ../java/jre/filetypes/PLJavaDescriptorValueFloat.h
    ../java/jre/filetypes/PLJavaDescriptorValueInt.cpp
    ../java/jre/filetypes/PLJavaDescriptorValueInt.h
    ../java/jre/filetypes/PLJavaDescriptorValueLong.cpp
    ../java/jre/filetypes/PLJavaDescriptorValueLong.h
    ../java/jre/filetypes/PLJavaDescriptorValueShort.cpp
    ../java/jre/filetypes/PLJavaDescriptorValueShort.h
    ../java/jre/filetypes/PLJavaDescriptorValueBoolean.cpp
    ../java/jre/filetypes/PLJavaDescriptorValueBoolean.h
    ../java/jre/filetypes/PLJavaDescriptorValueArray.cpp
    ../java/jre/filetypes/PLJavaDescriptorValueArray.h
    ../java/jre/filetypes/PLJavaDescriptorValueReference.cpp
    ../java/jre/filetypes/PLJavaDescriptorValueReference.h
    ../java/jre/filetypes/PLJavaFrame.cpp
    ../java/jre/filetypes/PLJavaFrame.h
)

SET(KERNEL_SRC
	${KERNEL_START}
	${KERNEL_LIB_SRC}
    ${KERNEL_INITRD_SRC}
	${KERNEL_LIBC_SRC}
	${KERNEL_LIBCXX_SRC}
	${KERNEL_LIBELF_SRC}
	${LIB_PLSDK_CORE_KERNEL_SRC}
    ${LIB_PLSDK_KERNEL_LANG_SRC}
	${LIB_PLSDK_TOOLS_SRC}
	${LIB_PLSDK_EXCEPTION_BASE_SRC}
	${LIB_PLSDK_EXCEPTION_SRC}
	${KERNEL_ASM_PROCESSOR_SPEC_SRC}
	${KERNEL_CXX_PROCESSOR_SPEC_SRC}
	${KERNEL_MACHINE_PROCESSOR_SRC}
	${KERNEL_MACHINE_PROCESS_SRC}
	${KERNEL_GLOBAL_SRC}
	${KERNEL_MACHINE_SRC}
	${KERNEL_MACHINE_PC_SRC}
	${KERNEL_MACHINE_MEMORY_SRC}
    ${JAVA_JRE_SRC}
)

SET(CMAKE_CXX_COMPILE_OBJECT "${gplusplus} ${KFLAGS} ${WFLAGS} ${OPTIMIZEFLAGS} ${KINCLUDES} -DKERNEL -c -o <OBJECT> <SOURCE>")
SET(CMAKE_C_COMPILE_OBJECT "${gcc} ${KCFLAGS} ${WFLAGS} ${OPTIMIZEFLAGS} ${KINCLUDES} -DKERNEL -c -o <OBJECT> <SOURCE>")
SET(CMAKE_ASM_COMPILE_OBJECT "nasm -f elf <FLAGS> -o <OBJECT> <SOURCE>")
SET(CMAKE_AR "${gar}")
SET(CMAKE_RANLIB "${granlib}")
SET(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS>")
SET(CMAKE_C_ARCHIVE_APPEND "<CMAKE_AR> r  <TARGET> <LINK_FLAGS> <OBJECTS>")
SET(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> <TARGET>")
SET(CMAKE_CXX_ARCHIVE_CREATE ${CMAKE_C_ARCHIVE_CREATE})
SET(CMAKE_CXX_ARCHIVE_APPEND ${CMAKE_C_ARCHIVE_APPEND})
SET(CMAKE_CXX_ARCHIVE_FINISH ${CMAKE_C_ARCHIVE_FINISH})
IF(X86)
	SET(LD_FILE "kernel/machine/pc/processor/x86/kernel.ld")
ENDIF(X86)
SET(CMAKE_CXX_LINK_EXECUTABLE "${ld} -T${CMAKE_SOURCE_DIR}/${LD_FILE} --eh-frame-hdr <OBJECTS> -o <TARGET>")

add_executable( bubblesos ${KERNEL_SRC} )

add_dependencies( bubblesos libcxx )
add_dependencies( bubblesos libc )
